<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        #banner{
            width: 100%;
            height: 300px;
            background: #caf;
        }
        .mask{
            box-sizing: border-box;
            position:absolute;
            width: 100%;
            height: 100%;
            background:rgba(0,0,0,0.5);
            z-index: 2;
            left: 0;
            top: 0;
            padding: 40px 50px;
            text-align: center;
        }
    </style>
</head>
<body>
    <a href="http://atguigu.com"><div id="banner"></div></a>
    <div class="mask">
        <h3>恭喜恭喜, 中奖啦!!</h3>
        <button id="close">点击关闭</button>
    </div>

    <script>
        //获取元素
        let close = document.querySelector("#close");
        let mask = document.querySelector(".mask");

        //绑定事件
        close.addEventListener('touchstart', function(){
            mask.style.display = 'none';
        })

    </script>
</body>
</html>